home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
CD ROM Paradise Collection 4
/
CD ROM Paradise Collection 4 1995 Nov.iso
/
os2
/
adaptor.zip
/
ADAPT.ZIP
/
adaptor
/
examples
/
dalib
/
schedule
/
switch.f
< prev
Wrap
Text File
|
1993-06-28
|
620b
|
39 lines
program indirect
c test bed for indirect addressing, here switch
integer N
parameter (N = 16)
integer A(N), B(N), P(N)
integer HA (N)
cmf$ layout HA(:host)
integer I
c
c init A
forall (I=1:N) A(I) = I
c make P to a switch vector
!HPF$ INDEPENDENT, LOCAL_ACCESS
do I = 1, N
X = mod (I-1,4)
if (X .ge. 2) then
X = I - 2
else
X = I + 2
end if
P(I) = X
end do
c
HA = P
print *, 'P = ', HA
B = A(P)
HA = B
print *, 'B = A[P]', HA
end